home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d23 / narc13.arc / NARC.DOC < prev    next >
Text File  |  1987-11-23  |  64KB  |  1,606 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.                    NARC - A STAND-ALONE DE-ARCHIVE UTILITY
  12.                            (no other files required)
  13.  
  14.  
  15.  
  16.  
  17.                          Documentation for NARC.EXE
  18.  
  19.  
  20.                            Written by Gary Conway
  21.  
  22.  
  23.                           Infinity Design Concepts
  24.  
  25.  
  26.                             Louisville, Kentucky
  27.  
  28.  
  29.                              Copyright (c) 1987,88
  30.  
  31.  
  32.                                 Version 1.3
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.        NARC.DOC            Copyright (c) 1987    Infinity Design Concepts
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                NARC.EXE  is  placed  in the public  domain  under  the  user 
  71.                supported shareware concept. NARC.EXE is and will remain  the 
  72.                property of Gary Conway. This program may not be used in  any 
  73.                connection  with  commercial ventures, nor as  a  sales  aid, 
  74.                without  the  expressed written consent of  the  author.  All 
  75.                rights are reserved.
  76.  
  77.  
  78.                          Infinity Design Concepts
  79.                          1052 Parkway Drive
  80.                          Louisville, Kentucky 40217
  81.  
  82.                  Member  IEEE
  83.                          KIPCUG
  84.                          PCCL
  85.                          KKUG
  86.                          NSPE
  87.  
  88.  
  89.                  All  new releases of NARC.EXE and all other  IDC  utilities 
  90.                can be located -FIRST- on ;
  91.  
  92.                  The SoftStone   FOG #24  (supporting CP/M and MSDOS)
  93.                  (502)241-4109
  94.                  40 MEG
  95.                  300/1200/2400 baud
  96.                  24 hrs.
  97.                  Louisville, Kentucky
  98.  
  99.                  Curt Edwards - SYSOP
  100.  
  101.          Sponsored by:   Kentucky Kaypro Users Group
  102.                          Accounting Computer Systems
  103.                          First Osborne Group
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.        NARC.DOC            Copyright (c) 1987    Infinity Design Concepts
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.                                        REGISTRATION
  132.  
  133.  
  134.                      If  you find yourself using NARC, please take the  time 
  135.                to  do  the right thing and that is register your  copy.  You 
  136.                have been provided the opportunity to freely test the program 
  137.                before  even thinking about registering. This is  only  fair, 
  138.                so,  in  fairness, you should reciprocate and  register  your 
  139.                copy,  if you continue using the program. There  are  several 
  140.                ways  to register NARC.
  141.  
  142.                 Why register ?
  143.  
  144.                 1) You get the NARCCFG.EXE program for customizing NARC.
  145.                 2) You get notification of updates to the program.
  146.                 3) You get patch table information.
  147.                 4) You get FREE net-mail services for contacting IDC.
  148.  
  149.                 Disk only with current version ..................  $20.00
  150.                 (includes manual on disk)
  151.                 Printed manual ..................................  $15.00
  152.                 (bound and printed manual)
  153.                 Printed manual and disk .........................  $35.00 
  154.                 Site License ....................................  $50.00
  155.                 (required for business use)
  156.  
  157.  
  158.                Registered  users  can  obtain update  disks  for  $5.00.
  159.  
  160.                      You will find the registration form in the ARChive with 
  161.                this  document under the name REGISTER.FRM. Please  use  this 
  162.                form for registration.
  163.  
  164.  
  165.  
  166.                                 THIS IS NOT A FREE PROGRAM
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.        NARC.DOC            Copyright (c) 1987    Infinity Design Concepts
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.                            ═════════════════════════════════════════
  199.                            70%      F A S T E R  E X T R A C T I O N
  200.                            ═════════════════════════════════════════
  201.  
  202.  
  203.  
  204.                 There has been a large number of requests for an increase in 
  205.                extraction  speed.  NARC  version  1.2  demonstrates  a   70% 
  206.                increase over previous releases.
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.        NARC.DOC            Copyright (c) 1987    Infinity Design Concepts
  243.  
  244.  
  245.  
  246.  
  247.  
  248.   .............................................................................
  249.   ........................                         ............................
  250.   ........................    TABLE OF CONTENTS    ............................
  251.   .............................................................................
  252.  
  253.  
  254.                                                                Page
  255.            WHAT IS IT ANYWAY..................................  1
  256.            ACKNOWLEDGEMENTS...................................  1
  257.            COMPATIBILITY......................................  2
  258.                Author's Ramblings.............................  2
  259.                ARChive Storage Methods Supported By NARC......  2
  260.                    Packing
  261.                    Squeezing
  262.                    Crunching
  263.                    Squashing
  264.            OVERVIEW...........................................  3
  265.            COMMANDS...........................................  4
  266.                Extract Command................................  4
  267.                View Command...................................  5
  268.                Print Command..................................  5
  269.                ARC-wind Command...............................  6
  270.                DRV-wind Command...............................  6
  271.                SUB-wind Command...............................  6
  272.                Quit Command...................................  6
  273.            ALTERNATE COMMANDS.................................  6
  274.                Function keys
  275.                Find Command
  276.                Kill File Command
  277.                Page UP, DOWN, HOME,END
  278.            OPERATING HINTS AND SHORTCUTS......................  8
  279.            ERROR MESSAGES.....................................  9
  280.            ARCHIVE FILE FORMATS AND GENERAL INFORMATION.......  10
  281.                Packing........................................  10
  282.            HUFFMAN CODING (SQUEEZING).........................  11
  283.            CRUNCHING (LZW COMPRESSION)........................  15
  284.            DETAILS OF STORAGE VERSIONS........................  17
  285.                ARChive file Header Structure..................  19
  286.            HASHING............................................  20
  287.                CRC - calculations.............................  20
  288.            ARC RELEASE DATES AND VERSIONS.....................  21
  289.  
  290.  
  291.  
  292.      ........................................................................
  293.            Narc (c) 1987 Infinity Design Concepts   all rights reserved
  294.      ........................................................................
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.        NARC.DOC            Copyright (c) 1987    Infinity Design Concepts
  304.  
  305.                                 ═══════════════════
  306.                                 WHAT IS IT ANYWAY ?
  307.                                 ═══════════════════
  308.  
  309.  
  310.                NARC  is a menu driven de-ARChive facility, written  entirely 
  311.                in assembler. NARC allows you to easily move from ARC file to 
  312.                ARC file, with the option of viewing, printing, extracting or 
  313.                deleting  the subfiles from the ARChive. The program  may  be 
  314.                operated  from  the mouse or the keyboard. Menus are  of  the 
  315.                musical  popup variety to add a little "TechNoFlash"  to  the 
  316.                proceedings.  NARC is the culmination of about six months  of 
  317.                frustrating effort and 10000 + lines of 8088 source code.
  318.  
  319.                Why....
  320.  
  321.  
  322.                  Because  I  use a lot of ARC  files and   ARC.EXE  and  the 
  323.                clones  are  reminiscent  of  the  early   Ward   Christensen 
  324.                CP/M  days in user interface etiquette, I wanted something  a 
  325.                little  more  flexible and friendly to use. I would  like  to 
  326.                pause  here  for  a second and give a little  credit  to  Mr. 
  327.                Christensen  (  the Don Garlits of CP/M ) for the  fine  FREE 
  328.                utilities he has given to ALL of us over the years. The  next 
  329.                time  you  do  a modem transfer, you can thank  him  for  the 
  330.                original XMODEM from which all others have transpired.
  331.  
  332.            Why NARC...
  333.  
  334.                It  seemed like a good idea. Short for uN-ARC. The  idea  was 
  335.                originally Bob Freed's.
  336.  
  337.            Acknowledgments..
  338.  
  339.                I  would  like  to thank Bob Freed for  his  allowing  me  to 
  340.                examine his Z80 code before writing NARC. Bob wrote UNARC for 
  341.                the  CP/M world and is ( as of this writing 4/28/87)  working 
  342.                on  NOAH  the ARCing program for CP/M. I would also  like  to 
  343.                thank  System  Enhancement  Associates  for  releasing  their 
  344.                source  code  in "C". Without both of the above,  NARC  would 
  345.                have been a much larger chore than it was. Note also that the 
  346.                crunching algorithm used in ARC.EXE was taken from  COMPRESS, 
  347.                used in UNIX. A special thanks to Curt Edwards, Jerry Taylor, 
  348.                Frank Roemer, Paul Bowling and Ken Romines for their  "eagle-
  349.                eyes" in locating errors.
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.        NARC.DOC            Copyright (c) 1987    Infinity Design Concepts
  364.           
  365.                                      Page 1
  366.  
  367.                                 ═════════════
  368.                                 COMPATIBILITY
  369.                                 ═════════════
  370.  
  371.  
  372.                NARC  is compatible with all known  "skrunching"  algorithms, 
  373.                that  is  up to and including Squashing. NARC  is  compatible 
  374.                with ARC.EXE version 5.21 and PKxARC. NARC supports Squashing 
  375.                which  is  nothing  more than a variation  of  the  crunching 
  376.                algorithm,  yet it is the easiest (and most logical)  of  the 
  377.                crunching methods to code. I have heard a lot of criticism of 
  378.                squashing,  but  those folks need to get up with  the  times, 
  379.                squashing  is  (and  should  be)  here  to  stay.  NARC  also 
  380.                recognizes  the  .ARK extension soon to be prevalent  in  the 
  381.                CP/M world via Bob Freed's CP/M archive facility, NOAH.
  382.  
  383.  
  384.            Author's Ramblings
  385.  
  386.  
  387.                System Enhancement Associates, I am told is dropping the ball 
  388.                as far as ARC.EXE goes. I think that Thom Henderson  deserves 
  389.                a great round of applause for his contribution and help  with 
  390.                a   formidable  problem,  namely,  storage  space  (or   lack 
  391.                thereof).
  392.  
  393.                  The  oldest version of ARC.EXE that I can find  is  version 
  394.                3.10, released 5-1-85. This version supports storage  methods 
  395.                up  to and including squeezing (no crunching). If anyone  has 
  396.                an older version I would be interested in seeing it. Here  is 
  397.                a list of the versions that I do have and would be interested 
  398.                in getting any other versions floating around.
  399.  
  400.                  3.10    4.10    4.50    4.52    5.00    5.10    5.12    5.20
  401.  
  402.  
  403.                        ═════════════════════════════════════════
  404.                        ARCHIVE STORAGE METHODS SUPPORTED BY NARC
  405.                        ═════════════════════════════════════════
  406.  
  407.  
  408.  
  409.                          Packing         - all versions
  410.                          Squeezing       - Huffman Coding
  411.                          Crunching       - all versions (LZW encoding)
  412.                          Squashing       - one version
  413.  
  414.  
  415.          Note: LZW stands for Lempel-Ziv-Welch
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.        NARC.DOC            Copyright (c) 1987    Infinity Design Concepts
  426.           
  427.                                      Page 2
  428.  
  429.            OverView...
  430.  
  431.                When  NARC is first invoked, it saves the current  drive/path 
  432.                for  use  again  on  exit, so you always  end  up  where  you 
  433.                started.  Some  folks like that and some don't.  I  DO.  NARC 
  434.                first searches the default path for ARC files and if any  are 
  435.                found they are displayed in a window on the left side of  the 
  436.                screen. The arrow keys (or the mouse) may be used to move the 
  437.                cursor  bar up and down the window, there are three  ways  to 
  438.                select the highlighted ARC file ;
  439.  
  440.                  (1) Hit the ENTER key
  441.                  (2) Press the left mouse button
  442.                  (3) Hit the F1 key.
  443.  
  444.            NOTE: Function keys F1 and F2 mimic the mouse buttons as ;
  445.  
  446.                  F1 = left mouse button
  447.                  F2 = right mouse button
  448.                  F3 = both mouse buttons
  449.  
  450.                NARC will determine whether a monochrome or color monitor  is 
  451.                being used and act accordingly. EGA is not directly supported 
  452.                at  this point, because I don't have one and can't  test  the 
  453.                routines.
  454.  
  455.  
  456.                After  selecting the sub-file of interest, NARC displays  all 
  457.                of the ARC sub-files and their statistics on the screen.  You 
  458.                are  also given a menu bar at the bottom of the  screen.  You 
  459.                may use the arrow keys or the mouse to move the cursor bar to 
  460.                the desired selection and then select with the F1 key or  the 
  461.                ENTER  key  or the left mouse button. As the  cursor  bar  is 
  462.                moved,  you  are  also  given  a  brief  description  of  the 
  463.                highlighted  command.  The  commands will  now  be  discussed 
  464.                individually.
  465.  
  466.  
  467.          Note: You may also select any option from the command bar by
  468.                entering the first letter of the command.
  469.  
  470.                The ESCape key will exit the program from any of the  windows 
  471.                or the command bar.
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.        NARC.DOC            Copyright (c) 1987    Infinity Design Concepts
  488.           
  489.                                      Page 3
  490.  
  491.                                    ════════
  492.                                    COMMANDS
  493.                                    ════════
  494.  
  495.  
  496.            ═══════════════
  497.            Extract Command
  498.            ═══════════════
  499.  
  500.                  Selecting  this  option  will cause another  prompt  to  be 
  501.                displayed, asking whether you wish to extract the highlighted 
  502.                file or tagged files. (Files are tagged with the space  bar). 
  503.                "Point  and shoot" here again as before. The ESC key  or  the 
  504.                right  mouse  button will abort the operation.  If  the  disk 
  505.                becomes  full,  you will be informed and have the  option  of 
  506.                aborting or continuing.
  507.  
  508.  
  509.            Highlighted File
  510.  
  511.                  When  EXTRACT  is  selected,  you  will  be  asked  for   a 
  512.                drive/path to extract the file to. If you simply hit ENTER or 
  513.                the  F1  key  or  the left mouse button,  the  file  will  be 
  514.                extracted  to the default drive/path. You may also enter  any 
  515.                valid DOS drive/path. The ESC key or the F2 key or the  right 
  516.                mouse button will abort the operation.
  517.          
  518.  
  519.            Tagged Files
  520.  
  521.                  The Space bar (or F3 key) is used to TAG the current  file. 
  522.                When  a file is tagged, an asterisk will be displayed on  the 
  523.                line with the current file in column 80. As a side note,  the 
  524.                asterisk was chosen as a reminder of the CP/M days of  NSWEEP 
  525.                and  B29. The space bar will also unTAG a file, thus it is  a 
  526.                "toggle".  When  the space bar is pressed, an  asterisk  will 
  527.                appear as described above and     the cursor bar will move to 
  528.                the next file. When the "TAGGED" option is selected from  the 
  529.                command  line,  all  files that have  been  tagged,  will  be 
  530.                extracted to the SAME drive/path.
  531.  
  532.                  After the file is extracted, it's date and time are set  to 
  533.                those contained in the ARC file. The file is also checked for 
  534.                size and CRC, if both of these do not match exactly what  was 
  535.                contained in the ARC file header, then an error has  occurred 
  536.                and  the user is notified The files will also  remain  tagged 
  537.                after the extraction.
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.        NARC.DOC            Copyright (c) 1987    Infinity Design Concepts
  550.           
  551.                                      Page 4
  552.  
  553.            ════════════
  554.            View Command
  555.            ════════════
  556.  
  557.                  This option will display the currently highlighted file  on 
  558.                the screen. The PgUP, PGDN, Home and End keys, as well as the 
  559.                cursor  keys allow movement through the file. The file to  be 
  560.                viewed  is  first extracted to the default drive  to  a  file 
  561.                called NARC.TMP. This file is deleted when the view is ended. 
  562.                the  extraction is performed due to the sequential nature  of 
  563.                ARC  files, which makes it nearly impossible to  perform  the 
  564.                page  up,down  operations on the compressed file  itself.  If 
  565.                NARC  finds that there is not enough disk space or  directory 
  566.                space to create NARC.TMP, you will be asked for another drive 
  567.                where  the temporary file can be created.  No  mouse  support 
  568.                here, since it slows things down too much.
  569.  
  570.            ═════════════
  571.            Print Command
  572.            ═════════════
  573.  
  574.                  The print option will print the currently highlighted file. 
  575.                After  selecting  the print option, you will be  asked  which 
  576.                character  pitch you want to print in. Enter the number  that 
  577.                you wish (or 0 for the default pitch) and the printer will be 
  578.                set to that pitch.
  579.  
  580.          NOTE: The printer strings that come installed with NARC are compatible
  581.                with EPSON printer strings. If you wish to install NARC with
  582.                your own strings, see NARCCFG.DOC for complete instructions.
  583.  
  584.                  After  you  have selected the printer pitch,  you  will  be 
  585.                shown three more options. Use the arrow keys to move left and 
  586.                right.  The space bar (or right mouse) is used to toggle  the 
  587.                options  ON or OFF. When you have finished and are  ready  to 
  588.                print, hit ENTER (or left mouse button). The options are;
  589.  
  590.                  Format -        YES - This option causes NARC to format the
  591.                                        output with page breaks and page numbers.
  592.                                  NO  - NARC does not format the file.
  593.  
  594.          The following two options work independently of the Format option.
  595.  
  596.                  Strip High -    YES - NARC will strip the high bit off each
  597.                                        character before it is sent to the
  598.                                        printer. Some word processors set this
  599.                                        high bit on some characters as a means of
  600.                                        text formatting. These characters will
  601.                                        print as garbage usually.
  602.                                  NO  - NARC will not strip the high bit.
  603.  
  604.                  Strip Control - YES - NARC will strip all control characters
  605.                                        from the file before it is printed. This
  606.                                        is useful on files that have embedded
  607.                                        formatting characters, and you wish to
  608.                                        have NARC provide the formatting.
  609.                                  NO  - NARC will not strip the control chars.
  610.  
  611.        NARC.DOC            Copyright (c) 1987    Infinity Design Concepts
  612.           
  613.                                      Page 5
  614.  
  615.  
  616.                NOTE: On all of the follwing windows, the PG UP, PG DN,
  617.                      HOME and END keys in addition to the cursor keys
  618.                      allow movement through the window.
  619.  
  620.  
  621.            ════════════════
  622.            ARC-wind Command   Note: The right mouse button will also pop
  623.            ════════════════         this window up.
  624.  
  625.                  This  option will display the window containing all of  the 
  626.                ARC  files in the current sub-directory. Move the cursor  bar 
  627.                up and down with the mouse or arrow keys and select with  the 
  628.                F1 key or ENTER key or left mouse button.
  629.  
  630.            ════════════════
  631.            DRV-wind Command
  632.            ════════════════
  633.  
  634.                  This  option will pop up a window that contains all of  the 
  635.                logical drives that DOS reports to NARC. Select as before and 
  636.                the ARC-window will be popped up so that you can then  choose 
  637.                an ARC file to examine.
  638.  
  639.            ════════════════
  640.            SUB-wind Command
  641.            ════════════════
  642.  
  643.                  This  option will pop up a window that contains all of  the 
  644.                sub-directories in the current directory. Point and shoot  as 
  645.                before.   After   making  your  selection,  the   window   is 
  646.                automatically popped up again showing the sub-directories  in 
  647.                the new current directory. When you get to the directory that 
  648.                you  want, hit the F2 key or the right mouse button  and  the 
  649.                window will be put away and the ARC-window will be popped  up 
  650.                so that you can then select an ARC file.
  651.  
  652.            ════════════
  653.            Quit Command
  654.            ════════════
  655.  
  656.                  I hope I don't need to describe this one.
  657.                  NOTE: The ESCape key will also exit NARC.
  658.  
  659.            ══════════════════
  660.            ALTERNATE COMMANDS
  661.            ══════════════════
  662.  
  663.                 The extra commands can be located on the help screen,  which 
  664.                is invoked by the F10 key.
  665.  
  666.            F1 - key
  667.                 Will select the highlighted option.
  668.  
  669.  
  670.  
  671.  
  672.  
  673.        NARC.DOC            Copyright (c) 1987    Infinity Design Concepts
  674.           
  675.                                      Page 6
  676.  
  677.            F2 - key
  678.                 This  keys  function varies with the window that is  on  the 
  679.                screen  at any one time. When an ARC file is opened  and  the 
  680.                subfile  list is onscreen, this key will pop up the ARC  file 
  681.                window  again.  Any  other use of this key is  given  at  the 
  682.                appropriate time on the screen.
  683.  
  684.            F3 - key
  685.                 This  key will tag a subfile and move the cursor bar  on  to 
  686.                the next subfile. This key also has other functions, and they 
  687.                are also shown on the screen when necessary.
  688.  
  689.            F4 - key
  690.                The  F4  key  will  print an image of  the  screen  less  the 
  691.                advertisement and command lines. 
  692.  
  693.            F5 - key
  694.                Invokes  the NARC-DOS command processor.  You may then  enter 
  695.                any  valid DOS command.  When  finished,  simply  hit   ENTER   
  696.                by  itself  and you will be returned to NARC.  You  may  also 
  697.                enter   "COMMAND"  which  will  invoke  a  second   copy   of 
  698.                COMMAND.COM, if the file COMMAND.COM is in your search  path. 
  699.                To return to NARC, you would then type "EXIT". 
  700.  
  701.            F6 - key
  702.                This  key  will tag all of the subfiles in  the  ARChive  for 
  703.                subsequent extraction.
  704.  
  705.            F7 - key
  706.                 This  key will invert all of the tags on the subfiles,  that 
  707.                is all files that were tagged will become untagged and  vice-
  708.                versa.
  709.  
  710.            F10 - key
  711.                 This  key will display the NARC help screen with all of  the 
  712.                alternate  commands listed and a brief description  of  their 
  713.                functions.
  714.        ALT-F10  - key
  715.                 This sequence displays the trivia screen, where your serial
  716.                 number is located.
  717.  
  718.            (F)ind command.
  719.                Will  prompt for a wildcard filename to find in the  sub-file 
  720.                list. Any number of characters may be used, for example,  you 
  721.                may  enter  a single character and NARC will find  the  first 
  722.                file  whose name begins with that  character.  Alternatively, 
  723.                you may enter a complete wildcard specification and NARC will 
  724.                attempt to find a match.
  725.  
  726.            (K)ill file command.
  727.                Will  remove  the  currently highlighted  sub-file  from  the 
  728.                ARChive.  No additional disk space is required for  temporary 
  729.                files.
  730.  
  731.          PgUP,PgDN,Home and End
  732.                These  keys do what you might expect.  These  functions   are 
  733.                work in all windows.
  734.  
  735.        NARC.DOC            Copyright (c) 1987    Infinity Design Concepts
  736.           
  737.                                      Page 7
  738.  
  739.  
  740.  
  741.                        Operating Hints and Philosophy and Shortcuts
  742.  
  743.  
  744.  
  745.                    When NARC is first invoked, it pops up the window showing 
  746.                all  of  the ARC files in the current  directory.  The  first 
  747.                thing  that you must always do is to select an ARC file.  The 
  748.                reason  for this is that  when I want to look inside an   ARC  
  749.                file,  I  will move to that drive/directory  and  then   call 
  750.                NARC.   This saves me from having to select where I  want  to 
  751.                look  and what drive and all that mess.  This way,  when  the 
  752.                program  comes up, I can go right to work.  If you  run  NARC 
  753.                and  then  decide to change drives  or  directories,you  MUST 
  754.                first select an ARC file from the first window.
  755.  
  756.                    When  there  are no windows popped up,  the  right  mouse 
  757.                button  (or  F2  key)   will pop up  the   ARC  file  window, 
  758.                regardless  of where the command line cursor bar is. This  is 
  759.                handy  when  you have a lot of ARC's that you want  to  thumb  
  760.                through, with just the 2  mouse  buttons or F1 and  F2  keys,  
  761.                you  can  look  through a whole directory  of  ARC  files  in 
  762.                nothing flat !  Also along  these lines, when the ARC  window 
  763.                is  on the screen, the right mouse button or the  ESCape  key 
  764.                will exit the program.
  765.  
  766.  
  767.                          The  control system is a little tricky   at  first, 
  768.                but I think you will like it once you get used to it.
  769.  
  770.  
  771.  
  772.                  NARC  buffers  64k  of the input file  at  one  time,  thus 
  773.                speeding  up file operations.  The output buffer is  32k  and 
  774.                should  be  larger in the next version. NARC  requires  about 
  775.                170K of RAM to operate.
  776.  
  777.  
  778.                     (This prime advertising space for rent)
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.        NARC.DOC            Copyright (c) 1987    Infinity Design Concepts
  798.           
  799.                                      Page 8
  800.  
  801.                             ══════════════════════
  802.                                 Error Messages.
  803.                             ══════════════════════
  804.  Memory Allocation Error.
  805.          - NARC allocates memory when it is invoked, this says that DOS told
  806.            NARC that there was not enough memory left to run the program
  807.  
  808.  ERROR: Extraction Failed due to CRC error, Hit ENTER
  809.          - After a file is extracted, the CRC contained in the ARC header is
  810.            compared to the CRC that NARC calculates, this message says  that
  811.            the two were different. This is the CRC-16 polynomial.
  812.  
  813.  ERROR: Extraction Failed due to FileSize error
  814.          - Same as above, except with filesize
  815.  
  816.  ERROR: Disk File Inconsistency.  Hit ENTER
  817.          - This will usually mean that the user has swapped disks just after
  818.            telling NARC to View,Print or Extract and NARC does not recognize
  819.            the file.
  820.  
  821.  ERROR: Incompatible Crunch Format
  822.          - Says that either the stowage code for this file is not supported by
  823.            NARC -OR- there is an error in the ARC header
  824.  
  825.  ERROR: Extraction Failed due to Lack of Disk Space - (A)bort (C)ontinue
  826.          - Abort will stop tagged extraction, continue will try to fit next
  827.            file. 
  828.  
  829.  Squeezed File Has a Diseased Decode Tree.
  830.          - When unsqueezing a file, NARC has found a bad entry in the decode
  831.            table.
  832.  
  833.  ERROR: No directory space on destination!
  834.          - Self explanatory
  835.  
  836.  Bad Path Name, Hit ENTER
  837.          - The destination path that the user entered for extraction is not
  838.            a valid DOS pathname, re-enter.
  839.  
  840.  Requires DOS version 2.0 or above.
  841.          - NARC requires DOS 2.0 or above to operate.
  842.  
  843.  Invalid archive file format
  844.          - NARC could not find any ARC headers, this is probably not an ARC file
  845.  
  846.  Warning: Bad archive file header, bytes  skipped = xxxxx
  847.          - If an entry has a bad header, NARC will examine the next 64k bytes
  848.            looking for a good header.  This is to maintain compatibility with
  849.            ARC v.5.20 which allows self-unpacking ARC files.
  850.  
  851.  Unexpected end of  ARChive file
  852.          - Says that NARC couldn't find the last ARC header
  853.  
  854.  No matching file(s) in ARChive
  855.          - ARC file is empty
  856.  
  857.  
  858.  
  859.        NARC.DOC            Copyright (c) 1987    Infinity Design Concepts
  860.           
  861.                                      Page 9
  862.  
  863.  Cannot create work file, enter drive for temporary file
  864.  
  865.          - there was not enough directory space or disk space to
  866.            create NARC.TMP for viewing. Enter a drive letter where
  867.            NARC can create the necessary work file. The file will
  868.            be deleted when the view has ended.
  869.   
  870.                  ════════════════════════════════════════════
  871.                  ARCHIVE FILE FORMATS AND GENERAL INFORMATION
  872.                  ════════════════════════════════════════════
  873.  
  874.  
  875.                 For Those With a Little More Curiosity...
  876.  
  877.  
  878.  
  879.                The following are the currently supported stowage methods.
  880.  
  881.                 1    unpacked (obsolete)
  882.                 2    unpacked
  883.                 3    packed
  884.                 4    squeezed (after packing)
  885.                 5    crunched (obsolete)
  886.                 6    crunched (after packing) (obsolete)
  887.                 7    crunched (after packing, using faster hash algorithm)
  888.                 8    crunched (after packing, using dynamic LZW variations)
  889.                 9    Squashed c/o Phil Katz (no packing) (var. on crunching)
  890.  
  891.                 NOTE:    LZW is Lempel-Ziv-Welch crunching algorithm
  892.  
  893.  
  894.  
  895.                          A little about the stowage methods.
  896.  
  897.                 Packing -
  898.  
  899.                    This is the simplest of the storage methods. Suppose that 
  900.                you  have  a  line of  text  and at the end of the line,  you 
  901.                have  40 spaces. These 40 spaces are compressed into 3  bytes 
  902.                in the ARC file. The first  byte is the  actual character  to 
  903.                be  expanded  (in our case a space).  The second  byte  is  a 
  904.                special    "flag"  byte  that  indicates  that  we  need   to
  905.                expand these bytes. The third byte is the count byte (in  our 
  906.                case it would be 40). So you can see that any time the ARC'er 
  907.                finds  repeated bytes like this, it can compress them into  3 
  908.                bytes.  The anomalous case to watch out for here is when  the 
  909.                count  byte  is the same character as the "flag"  byte,  this 
  910.                proved to be a difficult roach to kill !
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.        NARC.DOC            Copyright (c) 1987    Infinity Design Concepts
  922.           
  923.                                      Page 10
  924.  
  925.                             ══════════════════════════
  926.                             HUFFMAN CODING (SQUEEZING)
  927.                             ══════════════════════════
  928.  
  929.  
  930.  
  931.                  It does, at first, seem that making a file smaller would be 
  932.                an  impossible  task. I will make an attempt here to  shed  a 
  933.                little light on this subject since that is a question that  I 
  934.                hear pretty frequently and it is not a two minute  discussion 
  935.                question. It does require some thought.
  936.  
  937.                  To  compress  a file with the Huffman  algorithm,  commonly 
  938.                called squeezing,  the  first  thing  that  must  be done  is 
  939.                to  read the file completely and  count the   occurrences  of 
  940.                each  character. That is you count the "A" 's and the "B"  's 
  941.                and  so  forth.  There are 256 characters  in  the   extended  
  942.                ASCII    character   set,  of  which  approximately  90   are 
  943.                "printable",   that is you can see  them on the  screen.  The 
  944.                IBM   set  has  more  "printables",   but  that  is   of   no 
  945.                consequence, since the squeezer deals  only with  the numbers 
  946.                and  doesn't  care whether or not the file is an  ASCII  text 
  947.                file  or  an EXE file.  Once  the squeezer  has  counted  the 
  948.                occurrences   of  each  character,  thus  the  frequency   of 
  949.                occurrence,  it  scans  the  table  for the  characters  that 
  950.                appear  the least number of times  and  forms  an   imaginary  
  951.                link  between  them,  called a node. Somewhere  else  in  the  
  952.                tree,  we will  later develop a pointer that points  to  this  
  953.                node.   When   you   start   putting  all  of  these   things 
  954.                together,  you  will form a binary tree in  memory.  Confused 
  955.                enough ? Let us try an example.
  956.  
  957.                  We   have   a   file  that  is 100 bytes  long  and  has  6 
  958.                different  characters   in   it.    We   have   counted   the 
  959.                occurrence  of each of the characters and found the following.
  960.  
  961.  
  962.                  quantity        character
  963.  
  964.                           5 -    D
  965.                          10 -    A
  966.                          10 -    F
  967.                          20 -    B
  968.                          25 -    E
  969.                          30 -    C
  970.  
  971.                  The  spelling  in the file wasn't very good, but  we  don't 
  972.                care.  Now  we take these numbers and  will  call  them   the  
  973.                frequency  of each character.  We then  arrange the table  as 
  974.                below.  This  is an arbitrary arrangement, but it  is  useful 
  975.                here  so  as  to make our tree readable on  the  screen.  The 
  976.                arrangement makes no difference.
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.        NARC.DOC            Copyright (c) 1987    Infinity Design Concepts
  984.           
  985.                                      Page 11
  986.  
  987.                 Frequency        20      10      5       10      30      25
  988.  
  989.                 Character        B       A       D       F       C       E
  990.  
  991.  
  992.                  We  then examine the table to find the two characters  with 
  993.                the  smallest  frequency of occurrence. In our  case,  it  is 
  994.                obvious that one of  them  is 5,but which 10 do we choose. As 
  995.                it turns out, it doesn't matter which one you choose, we will 
  996.                arbitrarily choose the F. We draw lines from the D and the  F 
  997.                to form our node (the box below).
  998.  
  999.  
  1000.                 Frequency        30      10     5        10      20      25
  1001.  
  1002.                 Character        C       A      D         F       B       E
  1003.                                                 \        /
  1004.                                                  \      /
  1005.                                                    ╔══╗
  1006.                                                    ║15║ = 5 + 10
  1007.                                                    ╚══╝
  1008.  
  1009.  
  1010.                    The number in the box is the sum  of the  frequencies  of 
  1011.                the  D  and  F characters. Now we again look for  the  lowest 
  1012.                two  frequencies, except, this time we do not consider the  D 
  1013.                and F characters individually, we instead consider the  node. 
  1014.                The  lowest two now are the A and  the node, that is  10  and 
  1015.                15. We again do some artwork.
  1016.  
  1017.  
  1018.                Frequency      30      10         5        10      20      25
  1019.  
  1020.                Character       C      A          D         F       B      E
  1021.                                       \          \       /               
  1022.                                        \          \     /
  1023.                                         \          ╔══╗
  1024.                                          \         ║15║ = 5 + 10
  1025.                                           \        ╚══╝
  1026.                                            \      /
  1027.                                             \    / 
  1028.                                              ╔══╗
  1029.                                              ║25║ = 10 + 15
  1030.                                              ╚══╝
  1031.  
  1032.  
  1033.                   We  look  at  the  table again for  the  next  two  lowest 
  1034.                frequencies  and   now find B and E .  We continue   in  this  
  1035.                fashion  until the entire "tree" is built, that is  until  it 
  1036.                all  condenses  to  one  node. The  leaves  are   the  actual  
  1037.                characters  at  the top of the tree and the  nodes  represent 
  1038.                branch joints with the root at the bottom.
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.        NARC.DOC            Copyright (c) 1987    Infinity Design Concepts
  1046.           
  1047.                                      Page 12
  1048.  
  1049.                 Frequency    30        10        5        10    20        25
  1050.  
  1051.                 Character    C         A        D         F     B        E
  1052.                               \         \       \         /      \       /
  1053.                                \         \       \       /        \     /
  1054.                                 \         \         ╔══╗            ╔══╗
  1055.                                  \         \        ║15║            ║45║
  1056.                                   \         \       ╚══╝            ╚══╝
  1057.                                    \         \      /              /
  1058.                                     \         \    /              /
  1059.                                      \         ╔══╗              /
  1060.                                       \        ║25║             /
  1061.                                        \       ╚══╝            /
  1062.                                         \       /             /
  1063.                                          \     /             /
  1064.                                           ╔══╗              /
  1065.                                           ║55║             /
  1066.                                           ╚══╝            /
  1067.                                             \            /
  1068.                                              \          /
  1069.                                                 ╔════╗
  1070.                                                 ║ROOT║
  1071.                                                 ╚════╝
  1072.  
  1073.  
  1074.                  Now  that our tree is made up, we can encode the  file.  We 
  1075.                start  at  the root (always). To encode the  first  character 
  1076.                (leaf) of the tree (the letter C), we trace up the tree until 
  1077.                we  hit  the letter C at  the top. Along our journey,  if  we 
  1078.                make  a  left turn, we record a 0 bit, and a 1  for  a  right 
  1079.                turn.  So for the C, we would go left to 55 (and record a  0) 
  1080.                and then left again to the letter C (and record another 0),so 
  1081.                the Huffman code for our letter C is 00. For A we go left  to 
  1082.                55,  right  to 25 and left to A and it becomes 010. By  doing 
  1083.                all of the letters  this way, we find the following.
  1084.  
  1085.  
  1086.                          C = 00          ( 2 bits )
  1087.                          A = 010         ( 3 bits )
  1088.                          D = 0110        ( 4 bits )
  1089.                          F = 0111        ( 4 bits )
  1090.                          B = 10          ( 2 bits )
  1091.                          E = 11          ( 2 bits )
  1092.  
  1093.                     Mind  that  the zeroes and ones above are bits  and  not 
  1094.                bytes.  Each    character  was represented in   the  original 
  1095.                file  by  8  bits (one byte) and since we  have  reduced  the 
  1096.                number  of  bits  needed  to  represent  each  character,  we 
  1097.                therefore reduce the size of the file.  The savings add up as 
  1098.                follows,
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.        NARC.DOC            Copyright (c) 1987    Infinity Design Concepts
  1108.           
  1109.                                      Page 13
  1110.  
  1111.                 character  frequency     original bits    squeezed bits  savings
  1112.  
  1113.                 C            30           30 x 8 = 240      30 x 2 = 60    180
  1114.                 A            10           10 x 8 = 80       10 x 3 = 30     50
  1115.                 D             5            5 x 8 = 40        5 x 4 = 20     20
  1116.                 F            10           10 x 8 = 80       10 x 4 = 40     40
  1117.                 B            20           20 x 8 = 160      20 x 2 = 40    120
  1118.                 E            25           25 x 8 = 200      25 x 2 = 50    150
  1119.                          ══════════               ══════            ═════  ═════
  1120.                 Totals      100                    800              240    560
  1121.                                                     │                │
  1122.                            original file size ──────┘                │
  1123.                            squeezed file size ───────────────────────┘
  1124.  
  1125.  
  1126.                     240  is 30% of 800, so we have compressed this  file  by 
  1127.                70%. Golly Wally, that seems pretty good. The rub lies in the 
  1128.                fact  that in order  to reconstruct  the original  file,   we 
  1129.                must  have  access to the decode  tree and since   each  tree 
  1130.                will  be different for each file, we must therefore save  the 
  1131.                tree  with the file.It turns out that the tree can have  only 
  1132.                256 nodes in a bytewise  compression technique and each  node 
  1133.                will  hold 4 bytes as pointers,a full table will be about  1k 
  1134.                long.  The table in our example has 5 nodes plus the  6  leaf 
  1135.                nodes  (where our characters are),  totaling 11.  4 times  11 
  1136.                is  44 and if we add a few bytes for storing the  node  count 
  1137.                and some other statistics, our table is about 50 bytes  long. 
  1138.                If we look at the 240 in the above table this gives the total 
  1139.                number  of bits that it will take to encode the file,  divide 
  1140.                240  by 8 to get the number of bytes (30) and add it  to  our 
  1141.                50,  we get a  compressed file  size of  80 bytes. Since  our 
  1142.                original file was 100 bytes, we have achieved a 20% reduction 
  1143.                in file size. Not bad. What we have really accomplished is  a 
  1144.                translation  of  character sets, with our new  set  requiring 
  1145.                less space than the original ASCII set.
  1146.  
  1147.                 How far can we go ?
  1148.  
  1149.                  If  we  look  at the maximums that we can  obtain  for  the 
  1150.                different  bit combinations in a optimally skewed tree,  that 
  1151.                is  a tree that is not exactly symmetrical, we find  that  we 
  1152.                can  have only 4 - 2 bit codes, 8 - 3 bit codes, 16 -  4  bit 
  1153.                codes, 32 - 5 bit codes, 64 - 6 bit codes, 128 - 7 bit codes, 
  1154.                the remaining 4 will be 8 bit codes.
  1155.  
  1156.  
  1157.                                  2       - 1 bit codes
  1158.                                  4       - 2 bit codes
  1159.                                  8       - 3 bit codes
  1160.                                  16      - 4 bit codes
  1161.                                  32      - 5 bit codes
  1162.                                  64      - 6 bit codes
  1163.                                  128     - 7 bit codes
  1164.                               --------
  1165.                                  254
  1166.  
  1167.  
  1168.  
  1169.        NARC.DOC            Copyright (c) 1987    Infinity Design Concepts
  1170.           
  1171.                                      Page 14
  1172.  
  1173.                      And  since  we have a total of 256 different  bytes  to 
  1174.                encode, the remaining 2 characters  must have 8 bit codes. If 
  1175.                we  add  the number of bits that this  represents,we  find  a 
  1176.                total  of  1554  bits or 195 bytes. So at  maximum,  we  have 
  1177.                compressed  the 256 bytes to 195 or 33%, thus the  idealistic  
  1178.                maximum  that can be  achieved with the Huffman algorithm  is 
  1179.                33% when using a byte level implementation.
  1180.  
  1181.                  One final note;  The Huffman scheme requires the input file 
  1182.                to  be read twice, once to count characters  and  frequencies 
  1183.                and  then  again  to  do the   actual  encoding.   The  major 
  1184.                differences in Huffman coding and  crunching lie in the  fact  
  1185.                that  crunching is a one pass operation and does not  require 
  1186.                the  table  to be stored with the file.  Both,  however,  are 
  1187.                extremely  vulnerable  to errors, for example,  imagine  what 
  1188.                would happen if you skipped one bit when squeezing the  file, 
  1189.                all of the remaining characters in the file would  become the 
  1190.                proverbial garbage, since we are looking at the file on a bit 
  1191.                level.
  1192.  
  1193.  
  1194.                     NARC  uses the method described in K. & R. pp.  130  for 
  1195.                setting  up the binary tree with several  modifications.  The 
  1196.                simple  binary  tree is acceptable for this, since  the  tree 
  1197.                never grows and therefore will never become unbalanced.
  1198.  
  1199.                  If  you  followed  that, now go back and  read  the  second 
  1200.                paragraph again, maybe it will make sense this time.
  1201.  
  1202.                             ══════════════════════
  1203.                                   CRUNCHING
  1204.                             ══════════════════════
  1205.  
  1206.  
  1207.                      Crunching began with an article by J. Ziv and A. Lempel 
  1208.                in  IEEE  Trans.  Information Theory,  May  1977,  where  the 
  1209.                method  was  originally  described. Terry A.  Welch  wrote  a 
  1210.                definitive application article in  IEEE Computer,  June  1984 
  1211.                which  described  in detail how to apply  the  algorithm  and 
  1212.                some    common  problems  encountered.  Thus  the  name   LZW 
  1213.                compression.
  1214.  
  1215.                       Crunching  takes  the  Huffman coding  method  a  step 
  1216.                further  as  it  does not include a table with  the  crunched 
  1217.                file.  The crunching algorithm also  "learns" as it  proceeds 
  1218.                through  the file. If it finds repeated strings in the  file, 
  1219.                they will be encoded into a table. This table is s et up  (in 
  1220.                NARC's  implementation)  as a  4096 by 3   table. Each  entry 
  1221.                is  formatted as <PREF>,<SUFFIX>,  where  PREF  is a  2  byte 
  1222.                pointer   to  another  entry.  SUFFIX  is the byte  for  this 
  1223.                entry. Representing the PREF's as pointers rather than values 
  1224.                speeds  up most operations in NARC. This idea came  from  Bob 
  1225.                Freed and is very trick.
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231.        NARC.DOC            Copyright (c) 1987    Infinity Design Concepts
  1232.           
  1233.                                      Page 15
  1234.  
  1235.                     One  obvious benefit of crunched files is the fact  that 
  1236.                there  is  no  need to  include the  encoding  table  in  the 
  1237.                compressed file as was the case with squeezing. Another great 
  1238.                benefit  is the fact that crunching is a one pass  operation 
  1239.                as opposed to the two pass situation in squeezed files.
  1240.  
  1241.                      Crunching begins by creating an "atomic" table, that is 
  1242.                a  table  in  RAM that contains 256  entries,  one  for  each 
  1243.                character  in  the  extended  ASCII  set.  The  values  range 
  1244.                sequentially from 0 to 255. The table entries are arranged as 
  1245.                follows.
  1246.  
  1247.                  Prefix Pointer (2 bytes) and Suffix byte (1 byte)
  1248.  
  1249.                In  this  initial  table setup, the Suffix bytes  are  the  0 
  1250.                through  255  mentioned  above.   These  are  the    "atomic"  
  1251.                characters,   in  that  they must be in   the  table   before  
  1252.                crunching or uncrunching can begin,  since all files  contain  
  1253.                some   portion  of this  character set. We do not know  which 
  1254.                characters will be included in any given file and which  ones 
  1255.                will  be excluded,so we must include them all in our  initial 
  1256.                table. Once this table is set up, we can begin crunching.
  1257.  
  1258.                    The Prefix pointer will contain a value that is a pointer 
  1259.                to another string. When the table is initially set up,  there 
  1260.                are  no other  strings,  so this  Prefix pointer is set to  a 
  1261.                special  "Null" string, that is it points nowhere.We must  be 
  1262.                careful  when  crunching the file, to look for  this  special 
  1263.                pointer and act accordingly when we encounter it.
  1264.  
  1265.                         This  Prefix and Suffix business is used to  "build" 
  1266.                long  strings.  If we read the input file and found that  the 
  1267.                first  character  was the letter "I",  we  would   look  this 
  1268.                letter  up  in  the string table  by  hashing  (computing  an 
  1269.                address).  If  we  found the letter in the  table  (which  we 
  1270.                certainly will on the first character),  then we  output it's 
  1271.                "hashed"   address   as  a  code to  the   output  file  (the 
  1272.                crunched  file).  Suppose then,  that  the   next   character  
  1273.                input  from the file was the letter "D",  the  cruncher would 
  1274.                then  look at the I and the D together to see if  they  exist 
  1275.                as a  string in the table. Well of course, since this is  the 
  1276.                second  character of the file, we know that it  doesn't,   so 
  1277.                the  cruncher  forms a new entry in the  string  table.  This 
  1278.                entry  has  as its' Prefix pointer, a value that "points"  to 
  1279.                the  letter  "I" entry  in the table, that we made  a  minute 
  1280.                ago.   The   suffix  byte in  this case would be  the  letter 
  1281.                "D".   Now   another code is  output to  the  crunched  file, 
  1282.                representing  the letter "D".  Well this is great,  we   have  
  1283.                now turned 2 bytes from the input file (16 bits) into 3 bytes 
  1284.                in  the  output file (24 bits). You  are  correct,  crunching 
  1285.                begins  by  "not crunching" , but it is a crazy world  !  The 
  1286.                real  value  becomes  apparent when we  run  into  this  same 
  1287.                sequence  "ID" in the input file again. Now we will  find  an 
  1288.                entry for it in the string table and we can  output a  single 
  1289.                12  bit code that stands for "ID", thus saving 4  bits.   The 
  1290.                cruncher  continues  "learning" strings like this  until  the 
  1291.                file  is crunched.  It should be noted that the string  table 
  1292.  
  1293.        NARC.DOC            Copyright (c) 1987    Infinity Design Concepts
  1294.           
  1295.                                      Page 16
  1296.  
  1297.                is dynamically changing as the input file is processed.
  1298.  
  1299.                      The  early versions of crunching  implemented,  stopped 
  1300.                "learning"  once the string table was full. This gave a  very 
  1301.                poor  compression ratio in some files. Versions 8 and 9  have 
  1302.                an additional feature called adaptive reset, where the string 
  1303.                table  is cleared and crunching begins all over again !  This 
  1304.                capability  really helps the larger files more  than  smaller 
  1305.                files.
  1306.  
  1307.  
  1308.  
  1309.  
  1310.                              Details of Storage Versions
  1311.  
  1312.  
  1313.                  NARC supports all of the current "skrunching" algorithms. A 
  1314.                brief description of each follows.
  1315.  
  1316.                                       Version    1
  1317.  
  1318.                 - "STORED" File is simply stored (obsolete now, 25 byte 
  1319.                header)
  1320.  
  1321.                  NOTE: Files stored with this version are rare.
  1322.  
  1323.                                       Version    2
  1324.                
  1325.                -  "STORED"  Current  version of  simple  storage.  This  
  1326.                version was implemented with the implementation of  file 
  1327.                compression.  The main difference in version 1 and 2  is 
  1328.                the  ARC header  (see header section below),  version  1 
  1329.                has a header length 4 bytes smaller than any of the rest 
  1330.                of the storage  methods since in  version 1 there was no 
  1331.                need to  store the  original file length separately from 
  1332.                the stored file length since they were the same.
  1333.  
  1334.                                       Version 3
  1335.  
  1336.                -  "PACKED" Repeated bytes are packed into a three  byte 
  1337.                string (see Packing above)
  1338.  
  1339.                                       Version    4
  1340.             
  1341.                - "SQUEEZED" after packing. The file is first packed  as 
  1342.                described above and then squeezed
  1343.  
  1344.                                       Version    5
  1345.  
  1346.                -  "CRUNCHED"  This is the first implementation  of  LZW 
  1347.                released. Uses fixed length codes and a complex  hashing 
  1348.                function. (obsolete now) (See hashing below)
  1349.  
  1350.                  NOTE: Files compressed with this version are hard to find.
  1351.                        Version was released only one month when next version
  1352.                        came out.
  1353.  
  1354.  
  1355.        NARC.DOC            Copyright (c) 1987    Infinity Design Concepts
  1356.           
  1357.                                      Page 17
  1358.  
  1359.                                       Version    6
  1360.  
  1361.                - "CRUNCHED" after packing. The file is first packed and 
  1362.                then  crunched.  Uses fixed length codes  and  the  same 
  1363.                hashing function as version 5.
  1364.  
  1365.                                       Version    7
  1366.  
  1367.                -  "CRUNCHED" after packing. Same as version 6 except  a 
  1368.                faster hashing function is used.
  1369.  
  1370.                  NOTE: Thom Henderson (author of ARC) has this to say about
  1371.                        version 7. "This approach was abandoned because dynamic
  1372.                        Lempel-Ziv works as well, and packs smaller also. However
  1373.                        inadvertent release of a developmental copy forces us to
  1374.                        leave this in."
  1375.  
  1376.  
  1377.                                       Version    8
  1378.  
  1379.                -  "CRUNCHED" after packing. Uses variable length  codes 
  1380.                in  the  crunched file (9 to 12 bits) and has  a  faster 
  1381.                hash function (actually not hashing at all, but for  the 
  1382.                sake of consistency, we will call it that). This version 
  1383.                also resets the string table when it becomes full  which 
  1384.                benefits  the  compression ratio of larger  files.  This 
  1385.                resetting is commonly called an adaptive reset.
  1386.  
  1387.  
  1388.                                       Version    9
  1389.  
  1390.                -  "SQUASHING"  (variation on  crunching  scheme).  This 
  1391.                version uses the same hashing function as version 8  but 
  1392.                varies  the crunching codes from 9 to 13 bits. There  is 
  1393.                also  no  packing, which affords the  string  table  the 
  1394.                opportunity to "learn" longer codes and thus improve the 
  1395.                compression ratio (benefits "real large" files).
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.        NARC.DOC            Copyright (c) 1987    Infinity Design Concepts
  1418.           
  1419.                                      Page 18
  1420.  
  1421.  
  1422.  
  1423.  ARC file header structure is same for both DOS and CP/M
  1424.  
  1425.  Byte number             Value(s)        Meaning
  1426.   ══════════════════════════════════════════════════════════════════════════
  1427.          1               1Ah             Header Flag
  1428.          2               0-9             Compression Version
  1429.          3-15            ---             ASCIIZ compressed filename
  1430.          16-19           ---             Compressed file size in bytes
  1431.                                          Low Word, High Word with each word
  1432.                                          in LoHi format
  1433.          20-21           bits            DOS date format
  1434.                          15-9            Year
  1435.                           8-5            Month
  1436.                           4-0            Day        (all zeroes means no date)
  1437.          22-23           bits            DOS time format
  1438.                          15-11           Hours (military)
  1439.                          10-5            Minutes
  1440.                           4-0            Seconds
  1441.          24-25           ---             CRC-16 in LoHi format of uncompressed
  1442.                                          file. ------- This is important.
  1443.          26-29           ---             Original uncompressed  file size
  1444.                                  NOTE:   Version 1 files are not compressed
  1445.                                          so the length can be  found with
  1446.                                          bytes 16-19, also the header len
  1447.                                          for version 1 files is 25 bytes.
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.  
  1464.  
  1465.  
  1466.  
  1467.  
  1468.  
  1469.  
  1470.  
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.        NARC.DOC            Copyright (c) 1987    Infinity Design Concepts
  1480.           
  1481.                                      Page 19
  1482.  
  1483.                 Hashing.....
  1484.  
  1485.                        Hashing is simply an arithmetic way of coming up with 
  1486.                an  address  in  a table. You have a  set  of  input  numbers 
  1487.                (codes)  that will map  one-to-one with the  output codes  in  
  1488.                an  ideal situation. That is, each time you input  a  certain 
  1489.                number,  you  can rest assured that the  output  will  always 
  1490.                return the same output number. This  is not quite the case in 
  1491.                the  current  versions of .ARC files.The reason is  that  the 
  1492.                algorithm   would   require   a  MEG  or  so   of   RAM   for 
  1493.                implementation. The utilization of a smaller string table  in 
  1494.                all  of  the  ARC  programs  introduces  the  possibility  of  
  1495.                producing   the  same   output number for  2  or  more  input 
  1496.                numbers.  This  is called a hash collision. This  is  handled 
  1497.                separately  in  .ARC files with what is called  a  "collision 
  1498.                table", which helps to locate the correct table entry.
  1499.  
  1500.  
  1501.                  There are three versions of "hashing" used in ARC files.
  1502.  
  1503.  Hash1   - Key = upper 12 bits of lower 18 bits of unsigned square of
  1504.                  (prefix code + suffix byte) OR 800h
  1505.  
  1506.                  Used in stowage versions 5 and 6
  1507.  
  1508.  Hash2   - Key = lower 12 bits of unsigned product of
  1509.                  (prefix code + suffix byte) * 15073
  1510.  
  1511.                  Used in stowage version 7
  1512.  
  1513.  Hash3   - Key = next available address in table.
  1514.  
  1515.                  Used in stowage versions 8 and 9
  1516.  
  1517.  
  1518.  
  1519.  
  1520.          CRC calculations -
  1521.  
  1522.                       NARC does not use the traditional table lookup  method 
  1523.                for  calculating  the  CRC of the file.  The  table  approach 
  1524.                requires  the  table to be in RAM and  takes up  more  space.  
  1525.                NARC calculates the CRC on the fly,  which  requires no table 
  1526.                and  saves space. The algorithm is taken from the  definitive 
  1527.                article  by    Aram  Perez   in IEEE  Micro,  June  '83.  The 
  1528.                polynomial is X^16 + X^15 + X^2 + X^1 which is not compatible 
  1529.                with the Xmodem CRC.
  1530.  
  1531.  
  1532.                                      Gary Conway
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540.  
  1541.        NARC.DOC            Copyright (c) 1987    Infinity Design Concepts
  1542.           
  1543.                                      Page 20
  1544.  
  1545.                         ══════════════════════════════
  1546.                         ARC RELEASE DATES AND VERSIONS
  1547.                         ══════════════════════════════
  1548.  
  1549.  
  1550.  
  1551.                These  are  the various versions of ARC.EXE that I  have  and 
  1552.                what versions of storage they supported. PKxARC supports  all 
  1553.                of  these  methods  as well since they  were  all  originally 
  1554.                created by ARC.EXE.
  1555.  
  1556.  
  1557.          Date                                   Stowage Methods
  1558.          Released        Version                   Supported
  1559.  
  1560.          05-01-85        3.10            Storing,Packing,Squeezing  (1-4)
  1561.                                            ( version 5 in here somewhere)
  1562.          06-26-85        4.10            Up to version 6 of crunching
  1563.          11-18-85        4.50            Up to version 6 of crunching
  1564.          12-04-85        4.52            Up to version 6 of crunching
  1565.                                            ( version 7 in here somewhere)
  1566.          01-21-86        5.00            Up to version 8 of crunching
  1567.          01-31-86        5.10            Up to version 8 of crunching
  1568.          02-05-86        5.12            Up to version 8 of crunching
  1569.          10-24-86        5.20            Up to version 8 of crunching
  1570.  
  1571.  
  1572.                  This  list is compiled in an attempt to start some kind  of 
  1573.                historical  record as to what transpired in the ARC world.  I 
  1574.                would be interested in hearing of additions.
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.  
  1592.  
  1593.  
  1594.  
  1595.  
  1596.  
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  End of NARC.DOC            Copyright (c) 1987    Infinity Design Concepts
  1604.           
  1605.                                      Page 21
  1606.